import sys
from mt5utils.mql5_utils import mql5_utils
from mt5utils.trade_utils import trade_utils
from serverapi.py_web import webApi
from utils.list_util import getExtremun,getFrameValue, series2List,getListArrToStr

sys.path.append(r'e:\workspace\python\py_spider')
#sys.path.append(r'C:\Users\Administrator\Desktop\py_spider')

mqlUtils = mql5_utils()
tradeUtils=trade_utils()

def runMain(test=False):
    if test is False:
        webApi().startServer()
    else:
        if mqlUtils.login():
            kFrameArr = mqlUtils.getBars("SOLUSDm",morethan=True)
            listValue=series2List(getFrameValue(kFrameArr,"close"))
            # headExtremun=getExtremun(listValue,True)
            supportStr=getListArrToStr(kFrameArr)
            # tradeUtils.singleOrder(1,symbol="XAUUSDm")
        else:
            print("登录失败")

if __name__ == '__main__':
    runMain(test=False)

   